package com.qf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 演示跨域访问问题和解决方案
 * @author fy
 * @version V1.0
 * @Project workspace
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/6/9 9:26
 */
@Controller
@RequestMapping("/origin")
@CrossOrigin("http://localhost:8081")
public class CrossController {


    @RequestMapping("/test1")
    @ResponseBody
    public String test1(){
        System.out.println("=================");
        return "ok";
    }
}
